/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * <p>Project: jse2204 - Op
 * <p>Powered by webrx On 2022-09-28 16:40:13
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Op {
    public static void main(String[] args) {
        Optional<String> op = Optional.empty();
        op = Optional.of("java");
        System.out.println(op.orElse("hello"));
        if(op.isPresent()){
            System.out.println(op.get());
        }

        List<String> list = new ArrayList<>();
        list.add("abc");
        list = null;
        if(list.size()!=0) {
            System.out.println(list.get(0));
        }else{
            System.out.println("hello");
        }
    }
}
